import request from '@/utils/request'

//获取学科简单列表
export function getSubjectSimpleApi() {
    return request({
        url:'/subjects/simple'
    })
}

//获取所有学科列表
export const getSubjectListApi = (params) => {
    return request({
        url: '/subjects',
        method: 'get',
        params
   })
}

//根据id获取学科详情
export const getSubjectInfoApi = (id) => {
    return request({
        url: '/subjects/' + id,
        method:'get'
   })
}

//增加学科
export const addSubjectApi = (data) => {
    return request({
        url: '/subjects',
        method: 'post',
        data
   })
}

//修改学科详情
export const editSubjectApi = (data) => {
    return request({
        url: '/subjects/' + data.id,
        method: 'put',
        data
   })
}

//删除学科数据
export const delSubjectApi = (id) => {
    return request({
        url: '/subjects/' + id,
        method: 'delete',
   })
}